public class Score {
    private Student student;
    private Course course;
    private double score;
    
    public static class ScoreException extends Exception {
        public ScoreException(String message) {
            super(message);
        }
    }
    
    public Score(Student student, Course course, double score) throws ScoreException {
        if (score < 0 || score > 100) {
            throw new ScoreException("分数必须在0-100之间！");
        }
        this.student = student;
        this.course = course;
        this.score = score;
    }
    
    public void displayInfo() {
        System.out.println("学生：" + student.getName() + 
                         "，课程：" + course.getCourseName() + 
                         "，分数：" + score);
    }
    
    public Student getStudent() { return student; }
    public Course getCourse() { return course; }
    public double getScore() { return score; }
}